﻿using Domain.Roles.Entities;
using Infrastructure.Data.Contexts;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Infrastructure.Data.Configurations
{
    internal class RoleConfiguration : IEntityTypeConfiguration<Role>
    {
        public void Configure(EntityTypeBuilder<Role> builder)
        {
            builder.ToTable(nameof(AppDbContext.Roles));
            builder.HasKey(u => u.Id);
            builder.Property(u => u.RoleName).IsRequired().HasMaxLength(100);
            builder.Property(u => u.Description).HasMaxLength(1000);
            builder.Property(u => u.PermissionSigns).IsRequired();
            builder.Property(u => u.Enable);
        }
    }
}
